package com.zhuss.vent.processor;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zhuss.bean.vo.vent.vent.DetailVentAppendVo;
import com.zhuss.exception.ExceptionCode;
import com.zhuss.exception.WpsException;
import com.zhuss.vent.db.dao.ext.VentAppendDao;


/**
 * 查询匿名吐槽Append processor
 * @Author: zhushanshuo
 * @Date: 2019/9/24 19:54
 */
@Component("ventAppendRead")
public class VentAppendRead {
	
	@Autowired
	private VentAppendDao ventAppendDao;
	
	
	public List<DetailVentAppendVo> listByType(Integer type, Long ventId, Long creatorId) {
		List<DetailVentAppendVo> list = ventAppendDao.listByType(type, ventId, creatorId);
		return list;
	}
	
	public DetailVentAppendVo getByType(Integer type, Long ventId, Long creatorId) {
		DetailVentAppendVo result = ventAppendDao.getByType(type, ventId, creatorId);
		return result;
	}
	
	/**
	 * 匿名吐槽Append详情
	 * @param ventAppendId
	 * @return
	 * @throws WpsException
	 */
	public Object detail(Long ventAppendId) throws WpsException {
		Object result = ventAppendDao.detail(ventAppendId);
		if (result == null) {
			throw new WpsException(ExceptionCode.数据不存在);
		}
		return result;
	}
	
	

}
